/*************************************************************************
	> File Name: P8814.cpp
	> Author: yufangze
	> Mail: 2224590123@qq.com
	> Created Time: 2025-04-02 14:02:33
 ************************************************************************/

#include <iostream>
#include <set>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;

void solve(long long n, long long d, long long e) {
    long long PsubQ = sqrt((n - e * d + 2) * (n - e * d + 2) - (n * 4));
    long long PaddQ = n - e * d + 2;
    long long P = (PsubQ + PaddQ) / 2;
    long long Q = PaddQ - P;
    if (P * Q == n && e * d == (P - 1) * (Q - 1) + 1 && P && Q) {
        printf("%lld %lld\n", min(P, Q), max(P, Q));
    } else {
        printf("NO\n");
    }
    return ;
}

int main() {
    long long k, n, d, e;
    cin >> k;
    while (k--) {
        scanf("%lld%lld%lld", &n, &d, &e);
        solve(n, d, e);
    }
    return 0;
}
